# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=py3-pyproj
_pkgname=pyproj
pkgver=2.6.0
pkgrel=1
pkgdesc="Python interface to PROJ (cartographic projections and coordinate transformations library)."
url="https://pyproj4.github.io/pyproj"
# broken with proj 7.1.0
# arch="all"
license="MIT"
depends="python3"
makedepends="python3-dev py3-setuptools proj-dev proj-util cython"
checkdepends="py3-pytest py3-numpy py3-mock"

source="https://github.com/pyproj4/pyproj/archive/v${pkgver}rel.tar.gz"
builddir="$srcdir/$_pkgname-${pkgver}rel"

case "$CARCH" in
# blocked by py3-numpy
mips*)	options="!check";;
esac

build() {
	python3 setup.py build
}

check() {
	modulebuilddir=$(python3 -c 'import sys,sysconfig; print("build/lib.{}-{}.{}".format(sysconfig.get_platform(), *sys.version_info[:2]))')
	PYTHONPATH="$builddir/$modulebuilddir" make test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="9f49e60ed927a73bb48f6776464f30a03419c5b27e0262091ab7db3b4eeb8e435a73b6c07c4e055f56ea43fbc2d8ddc13514a42c8e2d24569be4fbc5337ba7b4  v2.6.0rel.tar.gz"
